/*
 * Copyright 2008-2010 GP Software
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 *
 * FileGeneratorFactory.java | Created on Sep 15, 2010
 */
package org.gp.fileGenerator;

import org.gp.fileGenerator.mock.MockCsvUsersFileGenerator;
import org.gp.fileGenerator.mock.MockFixedWidthUsersFileGenerator;

/**
 * Factory class for file generators
 *
 * @author Paul Augustine C. Mendoza
 */
public class FileGeneratorFactory {

    protected FileGeneratorFactory() {
        // Do nothing....
    }

    public static FileGenerator getFileGenerator(FileGeneratorType type,
                                                 String templateBasePath) {
        FileGenerator fileGenerator;
        switch (type) {
            case MOCK_USERS_FIXED_WIDTH:
                fileGenerator = new MockFixedWidthUsersFileGenerator(
                        templateBasePath);
                break;
            case MOCK_USERS_CSV:
                fileGenerator = new MockCsvUsersFileGenerator(templateBasePath);
                break;
            default:
                throw new IllegalArgumentException(
                        "Unsupported file generator");
        }
        return fileGenerator;
    }
}
